/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *																 *
 *	CaseStudy2 - r2 Graphs Library Case Study 2					 *
 *																 *
 *	File:		Case2App.cpp									 *
 *	Authors:	Rafael Kikuchi ( shinjikik@gmail.com )			 *
 *				Rafael Romeiro ( rafaelromeiro@gmail.com )		 *
 *	Date:		14/09/2008										 *
 *	License:	CC-GNU LGPL										 *
 *				http://creativecommons.org/licenses/LGPL/2.1/	 *
 *	Version:	0.1.0											 *
 *																 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "Case2App.h"

void Case2App::init (void)
{
	cout << "Loading graph...";
	myGraph = new Graph("Case2Graph.txt", r2DIRECTED, r2LIST);
	cout << " Done!" << endl;
}

void Case2App::go (void)
{
	cout << "Writing info...";
	myGraph->WriteInfo("Case2Graph_info.txt");
	cout << " Done!" << endl;
	cout << "Writing BFS tree...";
	myGraph->WriteBFSTree("Case2Graph_bfs.txt", 1);
	cout << " Done!" << endl;
	cout << "Writing DFS tree...";
	myGraph->WriteDFSTree("Case2Graph_dfs.txt", 1);
	cout << " Done!" << endl;
	cout << "Writing components...";
	myGraph->WriteConnComponents("Case2Graph_components.txt");
	cout << " Done!" << endl;
	cout << "Writing cycle...";
	myGraph->WriteCycle("Case2Graph_cycle.txt");
	cout << " Done!" << endl;
}

void Case2App::release (void)
{
	delete myGraph;
}
